#!/usr/bin/env bash
# 当前执行文件目录
currentDir=$(cd `dirname $0`; pwd)
# 执行文件的上级目录
parentDir=$(dirname $currentDir)

echo "当前目录:"$currentDir
echo "上级目录:"$parentDir

#前端项目目录
frontDir=$HOME/WebstormProjects/vue-projects/member-h5-frontend
echo "frontDir="$frontDir
staticDir=$currentDir/src/main/webapp/WEB-INF/app
echo "staticDir="$staticDir

cd $frontDir
echo "=======================vue package begin==============================="
npm run build:sit
echo "=======================vue package begin==============================="

#如果文件夹存在，删除
if [ -d "$staticDir" ]; then
  rm -rf $staticDir
fi
mkdir $staticDir
cp -r -f $frontDir/dist/* $staticDir

echo "=======================success==============================="
